package main

import "log"
import "fmt"
import "net/http"

func main(){
	http.HandleFunc("/", handlor)
	log.Fatal(http.ListenAndServe("localhost:8800", nil))
}

func handlor(w http.ResponseWriter, r *http.Request){
	fmt.Fprintf(w, "%s %s %s\n", r.Method, r.URL, r.Proto)

	for k, v := range r.Header{
		fmt.Fprintf(w, "Header[%q] = %q\n", k, v)
	}

	fmt.Fprintf(w, "Host = %q\n", r.Host)
	fmt.Fprintf(w, "RemoteAddr = %q\n", r.RemoteAddr)

	if err := r.ParseForm(); err != nil {
		log.Print(err)
	}

	for k, v := range r.Form{
		fmt.Fprintf(w, "Form[%q] = %q\n", k, v)
	}
}